package org.example.spring_frist.LibraryProject;

import org.example.spring_frist.MessageProject.SpringMessageApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

import java.util.Collections;

@SpringBootApplication
public class SpringLibraryApplication {
    public static void main(String[] args) {
        //这个可以
//        SpringApplication.run(SpringLibraryApplication.class, args);

        //这个不可以
//        new SpringApplicationBuilder(SpringLibraryApplication.class).properties("server.port=8082").run(args);
        SpringApplication s = new SpringApplication(SpringLibraryApplication.class);

        s.setDefaultProperties(Collections.singletonMap("server.port", "8082"));

        s.run(args);
    }
}
